unit LlamaCpp.CType.Ggml;

interface

type
  TGgml = class
  public const
    GGML_ROPE_TYPE_NEOX = 2;
  end;

  {$MINENUMSIZE 4}
  TGGMLType = (GGML_TYPE_F32 = 0, GGML_TYPE_F16 = 1, GGML_TYPE_Q4_0 = 2,
    GGML_TYPE_Q4_1 = 3,
    // GGML_TYPE_Q4_2 = 4, support has been removed
    // GGML_TYPE_Q4_3 = 5, support has been removed
    GGML_TYPE_Q5_0 = 6, GGML_TYPE_Q5_1 = 7, GGML_TYPE_Q8_0 = 8,
    GGML_TYPE_Q8_1 = 9, GGML_TYPE_Q2_K = 10, GGML_TYPE_Q3_K = 11,
    GGML_TYPE_Q4_K = 12, GGML_TYPE_Q5_K = 13, GGML_TYPE_Q6_K = 14,
    GGML_TYPE_Q8_K = 15, GGML_TYPE_IQ2_XXS = 16, GGML_TYPE_IQ2_XS = 17,
    GGML_TYPE_IQ3_XXS = 18, GGML_TYPE_IQ1_S = 19, GGML_TYPE_IQ4_NL = 20,
    GGML_TYPE_IQ3_S = 21, GGML_TYPE_IQ2_S = 22, GGML_TYPE_IQ4_XS = 23,
    GGML_TYPE_I8 = 24, GGML_TYPE_I16 = 25, GGML_TYPE_I32 = 26,
    GGML_TYPE_I64 = 27, GGML_TYPE_F64 = 28, GGML_TYPE_IQ1_M = 29,
    GGML_TYPE_BF16 = 30, GGML_TYPE_Q4_0_4_4 = 31, GGML_TYPE_Q4_0_4_8 = 32,
    GGML_TYPE_Q4_0_8_8 = 33, GGML_TYPE_TQ1_0 = 34, GGML_TYPE_TQ2_0 = 35,
    GGML_TYPE_COUNT = Integer(36) // Number of types (excluding the commented ones)
    );

  TGgmlLogLevel = (GGML_LOG_LEVEL_NONE = 0, GGML_LOG_LEVEL_DEBUG = 1,
    GGML_LOG_LEVEL_INFO = 2, GGML_LOG_LEVEL_WARN = 3, GGML_LOG_LEVEL_ERROR = 4,
    GGML_LOG_LEVEL_CONT = 5);
  {$MINENUMSIZE 1}

  // Abort callback
  // If not NULL, called before ggml computation
  // If it returns true, the computation is aborted
  // typedef bool (*ggml_abort_callback)(void * data);
  TGgmlAbortCallback = function(const AData: pointer): boolean; cdecl;

  PGgmlTensor = ^TGgmlTensor;
  TGgmlTensor = NativeUInt;

  TGGMLLogCallback = procedure(level: TGgmlLogLevel; const text: PAnsiChar;
    user_data: pointer); cdecl;

implementation

end.
